home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / LEAVEOK.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  49 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3. #undef leaveok
  4.  
  5. #ifndef        NDEBUG
  6. char *rcsid_leaveok = "$Header: c:/curses/portable/RCS/leaveok.c%v 2.0 1992/11/15 03:28:59 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   leaveok()    - enable non-tracking cursor
  15.  
  16.   X/Open Description:
  17.        Normally, the hardware cursor is left at the location of the
  18.        window being refreshed.  This option allows the cursor to be
  19.        left whereever the update happens to leave it.  It is useful
  20.        for applications where the cursor is not used, since it reduces
  21.        the need for cursor motions.  If possible, the cursor is made
  22.        invisible when this option is enabled.
  23.  
  24.   PDCurses Description:
  25.        Though not explicitly stated, the cursor will be made visible
  26.        again, if leaveok() is passed a FALSE value.
  27.                        (Frotz:911226 Comments?)
  28.  
  29.   X/Open Return Value:
  30.        The leaveok() function returns OK on success and ERR on error.
  31.  
  32.   X/Open Errors:
  33.        No errors are defined for this function.
  34.  
  35.   Portability:
  36.        PDCurses        int leaveok( WINDOW* win, bool bf );
  37.        X/Open Dec '88  int leaveok( WINDOW* win, bool bf );
  38.        BSD Curses      int leaveok( WINDOW* win, bool bf );
  39.        SYS V Curses    int leaveok( WINDOW* win, bool bf );
  40.  
  41. **man-end**********************************************************************/
  42.  
  43. int    leaveok( WINDOW *win, bool bf )
  44. {
  45.        if  ((win->_leave = bf) != 0)   cursoff();
  46.        else                            curson();
  47.        return( OK );
  48. }
  49.